package com.yjz.designpattern.adapter_pattern;

/**
 * @author: yuanjinzhong
 * @date: 2021/12/30 5:49 下午
 * @description: 适配器
 */
public class Adapter extends Adaptee implements Target {
    private Target concertTarget;

    public Adapter(Target concertTarget) {
        this.concertTarget = concertTarget;
    }

    @Override
    public void hello() {
        concertTarget.hello();
    }

    @Override
    public void word() {
        System.out.println("Adaptee的sign方法代替target的word方法");
        super.sign();
    }
}
